## 将得到的数据生成matlab中domfluor工具所需要的格式
import numpy as np
import draw as d
import pandas as pd
directPath = ['510116000/','510116001/','510116002/','510116003/','510116004/','510116005/','510116006/']
fileName = 'nadh#--.sp'
spNumPerSample = 20
# 把矩阵导出到excel, 第一个参数是上面方法生成的, 第二个参数是目标目录, 需要手动创建
excelRootPath = './target/'
# 画图
toPath = './target/'
Ex = []
Em = []
fl = []
flag = 1 # Ex Em赋值一次就够了, fl数据才需要多次处理
for directPath in directPath:
    fileName = directPath[:len(directPath) - 1]
    X, Y, Z = d.read3DdataFromExcel(excelRootPath + fileName + '.xls')
    if flag == 1:
        Ex = X
        Em = Y
        flag = 0
    fl.append(Z) # np.array()
fl = np.array(fl)
fl = np.reshape(fl, (-1, fl.shape[2]))
# 生成dataframe
Ex = pd.DataFrame(Ex)
Em = pd.DataFrame(Em)
fl = pd.DataFrame(fl)
Ex.to_csv('./csv/ex.csv', header=None, index=None)
Em.to_csv('./csv/em.csv', header=None, index=None)
fl.to_csv('./csv/fl.csv', header=None, index=None)